﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetPassword.aspx.cs" Inherits="GetPassword" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var Bool = true;
        function CheckData() {
            var txt_UserName = document.getElementById("txt_UserName");
            var txt_Favorite = document.getElementById("txt_Favorite");
            var txt_Email = document.getElementById("txt_Email");
            var txt_NewPassword = document.getElementById("txt_NewPassword");
            var txt_PasswordAgain = document.getElementById("txt_PasswordAgain");
            var Data = new Array(4);
            Data[0] = txt_UserName;
            Data[1] = txt_Favorite;
            Data[2] = txt_Email;
            Data[3] = txt_NewPassword;
            Data[4] = txt_PasswordAgain;
            for (var i = 0; i < Data.length;i++ ) {
                if(Data[i].value=="")
                {
                    alert(Data[i].id + "\t" + "未填值");
                    return Bool = false;
                }
            }
         }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table  align="center"   style="padding: inherit; margin: inherit; border-style: inset; border-width: inherit; width:350px; table-layout: inherit; border-collapse: inherit; border-spacing: inherit; empty-cells: inherit; caption-side: inherit; line-height: inherit;">
    <tr><td  colspan="2" align="center">
        <asp:Label ID="Label1" runat="server" Text="取得我的密碼"></asp:Label></td></tr>
        <tr><td>
            <asp:Label ID="Label6" runat="server" Text="我的帳號"></asp:Label></td><td>
                <asp:TextBox ID="txt_UserName" runat="server"></asp:TextBox></td></tr>
    <tr><td>
        <asp:Label ID="Label2" runat="server" Text="我的最愛是"></asp:Label></td><td>
        
            <asp:DropDownList ID="drop_Favorite" runat="server" DataTextField="Favorite">
            </asp:DropDownList>
            <asp:TextBox ID="txt_Favorite" runat="server"></asp:TextBox>
        </td></tr>
        <tr><td>
            <asp:Label ID="Label5" runat="server" Text="我的Email"></asp:Label></td><td>
                <asp:TextBox ID="txt_Email" runat="server"></asp:TextBox></td></tr>
       <tr><td><asp:Label ID="Label3" runat="server" Text="新密碼"></asp:Label></td><td>
        <asp:TextBox ID="txt_NewPassword" runat="server" TextMode="Password"></asp:TextBox>
        </td></tr>
    <tr><td><asp:Label ID="Label4" runat="server" Text="確認密碼"></asp:Label></td><td>
        <asp:TextBox ID="txt_PasswordAgain" runat="server" TextMode="Password"></asp:TextBox>
        </td></tr>
    <tr><td align="center" colspan="2">
        <asp:Button ID="Button1" runat="server" Text="產生新密碼" onclick="Button1_Click"  OnClientClick="Bool=CheckData();return Bool"/></td></tr>
            </table>
    </div>
    </form>
</body>
</html>
